/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package id.or.liwet.main;

import javax.swing.JOptionPane;

/**
 *
 * @author Afrihar
 */
public class FibonacciJava {

    public static void main(String[] args) {
        String fiboInput;
        fiboInput = JOptionPane.showInputDialog("Please Input Fibonacci Series : ");

        int fiboInt = 0;
        fiboInt = Integer.parseInt(fiboInput);

        int fibonacci;
        long[] serial = new long[fiboInt];
        serial[0] = 0;
        serial[1] = 1;


        //CREATE FIBONACCI
        for (int i = 2; i < fiboInt; i++) {
            serial[i] = serial[i - 1] + serial[i - 2];
        }

        //PRINT OUT FIBONACCI
        for (int i = 0; i < fiboInt; i++) {
            JOptionPane.showMessageDialog(null, "The Fibonacci are " + serial[i]);
        }
        
    }
}
